package com.github.ghsea.sso.client.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author guhai
 * @since 2021/6/13 11:32
 */

@EnableShiro
@Configuration
public class ShiroConfiguration {

    @Bean
    public ShiroConfig shiroConfig() {
        ShiroConfig shiroConfig = new ShiroConfig();

        shiroConfig.setApplicationDomain("http://sample.ghsea.com")
                .setServletContextPath("/sample")
                .setCookieDomain(".ghsea.com")
                .setApiUrlGetPermissions("http://cas.ghsea.com/cas/authority/roleAndPermission?id={id}&&mail={mail}")
                .setApiUrlGetUser("http://cas.ghsea.com/cas/authority/getUser?mail={mail}")
                .setCasServerUrl("http://cas.ghsea.com/cas")
                .setRedisHost("127.0.0.1")
                .setRedisPort(6379);

        return shiroConfig;
    }
}
